home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 February / Macworld (1999-02).dmg / Games World / Hot Demos! / DroidWorks demo / dwCD.gob / mission_cog_inv_bacta.cog < prev    next >
Text File  |  1998-09-17  |  1KB  |  52 lines

  1. # Jedi Knight Cog Script
  2. #
  3. # ITEM_BACTA.COG
  4. #                                                                    
  5. # INVENTORY script - Bacta Tank
  6. #
  7. # [CYW & YB]
  8. #
  9. # (C) 1997 LucasArts Entertainment Co. All Rights Reserved
  10. # ========================================================================================
  11.  
  12. symbols
  13.  
  14. sound            bactaSnd=NRG00tBattUse.WAV
  15. thing            player
  16.  
  17. message        startup
  18. message        activated
  19.  
  20.  
  21. end
  22.  
  23. # ========================================================================================
  24.  
  25. code
  26. startup:
  27.      player=getlocalplayerthing();
  28.      maxhealth=getthinghealth(player);
  29.      damageuse=maxhealth-5;
  30.      return;
  31.  
  32. activated:     
  33.     if(GetInv(player, 15) > 0.0)
  34.     {
  35.         if(GetThingHealth(player) < damageuse)
  36.         {
  37.             Print("Using Bacta");
  38.  
  39.             if (dwcheckDroidCaps(1048576)!=0) dwplayplayerspeech("", 500);
  40.  
  41.             playsoundlocal(bactaSnd, 1.0, 0.0, 0);
  42.             HealThing(player, 30.0);
  43.             ChangeInv(player, 15, -1.0);
  44.             if(GetInv(player, 15) == 0) SetInvAvailable(player, 15, 0);
  45.         }
  46.           else dwplaycammyspeech(99999, "ghca056.wav", 5, 1); //inclines
  47.     }
  48.     
  49.     Return;
  50.  
  51. end
  52.